package org.soderiakelvy.model.services.testCase;

import java.util.List;

import junit.framework.Assert;

import org.junit.Test;
import org.soderiakelvy.model.domain.CondicionIvaVO;
import org.soderiakelvy.model.domain.PackVO;
import org.soderiakelvy.model.service.SujetoServicio;
import org.soderiakelvy.model.service.imp.SujetoServicioImpl;
import org.soderiakelvy.model.util.ConstantModel;


public class CondicionIvaTest {
	@Test
	public void condicionIvaCrud(){
		SujetoServicio service = new SujetoServicioImpl();
		CondicionIvaVO ci = new CondicionIvaVO();
		
		
		ci.setNombre("Test");
		Assert.assertEquals(ConstantModel.SUCCESS, service.insertCondicionIvaVO(ci));
		ci.setNombre("Test Modificado");
		Assert.assertEquals(ConstantModel.SUCCESS, service.updateCondicionIvaVO(ci));
		Assert.assertEquals(ConstantModel.SUCCESS, service.deleteCondicionIvaVO(ci));
		
		//----------- TEST  GETALL PACK ------------------------
				List<CondicionIvaVO> cis = service.getAllCondicioIvaVO();
				Assert.assertEquals(cis.size(), 2);
//				for(CondicionIvaVO c : cis){
//					System.out.println(c);
//				}
//				
				System.out.println("TEST GETALL OK");
		//-----------------------------------------------------------------------------
		
	}
}
